#include <iostream>

// 函数：计算数组元素的总和
int sumArray(int arr[], int size) {
    int sum = 0;
    for (int i = 0; i < size; ++i) {
        sum += arr[i];
    }
    return sum;
}

int main() {
    int numbers[5] = {1, 2, 3, 4, 5};
    int arraySize = sizeof(numbers) / sizeof(numbers[0]);

    // 调用函数计算数组元素的总和
    int result = sumArray(numbers, arraySize);
    std::cout << "Sum of array elements: " << result << std::endl;

    return 0;
}    